package net.oxygen.upload.service;

import io.minio.UploadPartResponse;
import io.minio.messages.Part;
import net.oxygen.upload.request.CompleteMultipartUploadRequest;
import net.oxygen.upload.request.MultipartUploadCreateRequest;
import net.oxygen.upload.request.UploadPartRequest;
import net.oxygen.upload.response.FileUploadResponse;
import net.oxygen.upload.response.MultipartUploadCreateResponse;
import net.oxygen.upload.util.JsonData;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 * 接口功能：文件操作服务接口
 * </p>
 *
 * @author 陈伟伟
 * @since 2023/12/18 16:29
 */
public interface IFileService {

    /**
     * 上传文件
     * @param file 文件对象
     * @return 上传结果
     */
    JsonData uploadFile(MultipartFile file);

    MultipartUploadCreateResponse createMultipartUpload(MultipartUploadCreateRequest request);

    UploadPartResponse uploadPart(UploadPartRequest request);

    Part[] listParts(CompleteMultipartUploadRequest request);

    FileUploadResponse completeMultipartUpload(CompleteMultipartUploadRequest uploadRequest);
}
